package cn.wenhe9.gulimall.product.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.wenhe9.gulimall.product.dao.AttrGroupDao;
import cn.wenhe9.gulimall.product.entity.AttrGroupEntity;
import cn.wenhe9.gulimall.product.service.AttrGroupService;


@Service("attrGroupService")
public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupDao, AttrGroupEntity> implements AttrGroupService {

    @Override
    public IPage<AttrGroupEntity> queryPage(Map<String, Object> params) {
        Long currnet = (Long) params.get("page");
        Long limit = (Long) params.get("limit");
        IPage<AttrGroupEntity> page = this.page(
                new Page<AttrGroupEntity>(currnet, limit),
                new QueryWrapper<AttrGroupEntity>()
        );
        return page;
    }

    @Override
    public void deleteBatch(List<Long> ids) {
        baseMapper.deleteBatchIds(ids);
    }

}